import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { ProductComponent } from './pages/product.componet';
import { CategoryListComponent } from './pages/category.componet';

const appRoutes: Routes = [
  { path: 'admin/category', component: CategoryListComponent },
  { path: 'admin/index', component: ProductComponent },
  { path: 'admin', redirectTo: 'admin/index', pathMatch: 'full' },
];


@NgModule({
  imports: [
    RouterModule.forRoot(
      appRoutes,
      {
        enableTracing: true // <-- debugging purposes only
      }
    )
  ],
  exports: [
    RouterModule
  ]
})
export class AppRoutingModule { }